From 44d32626bcfa01b0e76b0bf13ffde7abe6aded12 Mon Sep 17 00:00:00 2001 From: chrisparker126 Date: Fri, 30 Nov 2012 18:54:25 +0000 Subject: [PATCH] Added logic for rank calculation and interface methods Disabled posting when no post is selected Added notes section when viewing post (tres basic) fix for comment item serialisation fix for subscription token option not in this commit ;) git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5913 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/retroshare/rsposted.h | 37 +++- libretroshare/src/serialiser/rsposteditems.cc | 2 +- libretroshare/src/services/p3posted.cc | 127 ++++++++++++- libretroshare/src/services/p3posted.h | 51 ++++- .../src/gui/Posted/PostedComments.cpp | 14 +- .../src/gui/Posted/PostedComments.h | 6 +- .../src/gui/Posted/PostedComments.ui | 54 ++---- .../src/gui/gxs/GxsCommentTreeWidget.cpp | 177 +++++++++--------- .../src/gui/gxs/GxsCommentTreeWidget.h | 18 +- 9 files changed, 304 insertions(+), 182 deletions(-) diff --git a/libretroshare/src/retroshare/rsposted.h b/libretroshare/src/retroshare/rsposted.h index a10de0fef..3d0eb20fd 100644 --- a/libretroshare/src/retroshare/rsposted.h +++ b/libretroshare/src/retroshare/rsposted.h @@ -70,6 +70,7 @@ typedef std::map > PostedCommentResul typedef std::map > PostedVoteResult; typedef std::map > PostedRelatedCommentResult; typedef std::pair GroupRank; +typedef std::map PostedRanking; std::ostream &operator<<(std::ostream &out, const RsPostedGroup &group); std::ostream &operator<<(std::ostream &out, const RsPostedPost &post); @@ -81,6 +82,8 @@ class RsPosted : public RsGxsIfaceImpl { public: + enum RankType {TopRankType, BestRankType, NewRankType }; + static const uint32_t FLAG_MSGTYPE_POST; static const uint32_t FLAG_MSGTYPE_VOTE; static const uint32_t FLAG_MSGTYPE_COMMENT; @@ -91,19 +94,33 @@ virtual ~RsPosted() { return; } /* Specific Service Data */ -virtual bool getGroup(const uint32_t &token, std::vector &group) = 0; -virtual bool getPost(const uint32_t &token, PostedPostResult &post) = 0; -virtual bool getComment(const uint32_t &token, PostedCommentResult &comment) = 0; -virtual bool getRelatedComment(const uint32_t& token, PostedRelatedCommentResult& comments) = 0; -virtual bool getGroupRank(const uint32_t &token, GroupRank& grpRank) = 0; + virtual bool getGroup(const uint32_t &token, std::vector &group) = 0; + virtual bool getPost(const uint32_t &token, PostedPostResult &post) = 0; + virtual bool getComment(const uint32_t &token, PostedCommentResult &comment) = 0; + virtual bool getRelatedComment(const uint32_t& token, PostedRelatedCommentResult& comments) = 0; + virtual bool getRanking(const uint32_t& token, PostedRanking& ranking) = 0; -virtual bool submitGroup(uint32_t &token, RsPostedGroup &group) = 0; -virtual bool submitPost(uint32_t &token, RsPostedPost &post) = 0; -virtual bool submitVote(uint32_t &token, RsPostedVote &vote) = 0; -virtual bool submitComment(uint32_t &token, RsPostedComment &comment) = 0; + virtual bool submitGroup(uint32_t &token, RsPostedGroup &group) = 0; + virtual bool submitPost(uint32_t &token, RsPostedPost &post) = 0; + virtual bool submitVote(uint32_t &token, RsPostedVote &vote) = 0; + virtual bool submitComment(uint32_t &token, RsPostedComment &comment) = 0; // Special Ranking Request. -virtual bool requestRanking(uint32_t &token, RsGxsGroupId groupId) = 0; + /*! + * Makes request for posts of a topic + * @param token + * @param rType + * @param groupId + */ + virtual bool requestMessageRankings(uint32_t &token, const RankType& rType, const RsGxsGroupId& groupId) = 0; + + /*! + * Makes request for ranking of comments for a post + * @param token + * @param rType type of ranking to collect + * @param msgId message id of post as groupid-messageid pair + */ + virtual bool requestCommentRankings(uint32_t &token, const RankType& rType, const RsGxsGrpMsgIdPair& msgId) = 0; }; diff --git a/libretroshare/src/serialiser/rsposteditems.cc b/libretroshare/src/serialiser/rsposteditems.cc index 38421a8eb..5edc827ec 100644 --- a/libretroshare/src/serialiser/rsposteditems.cc +++ b/libretroshare/src/serialiser/rsposteditems.cc @@ -435,7 +435,7 @@ RsGxsPostedCommentItem* RsGxsPostedSerialiser::deserialiseGxsPostedCommentItem(v if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_GXSV1_TYPE_POSTED != getRsItemService(rstype)) || - (RS_PKT_SUBTYPE_POSTED_POST_ITEM != getRsItemSubType(rstype))) + (RS_PKT_SUBTYPE_POSTED_COMMENT_ITEM != getRsItemSubType(rstype))) { #ifdef GXS_POSTED_SERIAL_DEBUG std::cerr << "RsGxsPostedSerialiser::deserialiseGxsPostedCommentItem() FAIL wrong type" << std::endl; diff --git a/libretroshare/src/services/p3posted.cc b/libretroshare/src/services/p3posted.cc index d34e8f5ea..b67d334e7 100644 --- a/libretroshare/src/services/p3posted.cc +++ b/libretroshare/src/services/p3posted.cc @@ -14,7 +14,7 @@ RsPostedComment::RsPostedComment(const RsGxsPostedCommentItem & item) } p3Posted::p3Posted(RsGeneralDataService *gds, RsNetworkExchangeService *nes) - : RsGenExchange(gds, nes, new RsGxsPostedSerialiser(), RS_SERVICE_GXSV1_TYPE_POSTED), RsPosted(this) + : RsGenExchange(gds, nes, new RsGxsPostedSerialiser(), RS_SERVICE_GXSV1_TYPE_POSTED), RsPosted(this), mPostedMutex("Posted") { } @@ -129,11 +129,6 @@ bool p3Posted::getRelatedComment(const uint32_t& token, PostedRelatedCommentResu return RsGenExchange::getMsgRelatedDataT(token, comments); } -bool p3Posted::getGroupRank(const uint32_t &token, GroupRank &grpRank) -{ - -} - bool p3Posted::submitGroup(uint32_t &token, RsPostedGroup &group) { RsGxsPostedGroupItem* grpItem = new RsGxsPostedGroupItem(); @@ -177,7 +172,125 @@ bool p3Posted::submitComment(uint32_t &token, RsPostedComment &comment) } // Special Ranking Request. -bool p3Posted::requestRanking(uint32_t &token, RsGxsGroupId groupId) +bool p3Posted::requestCommentRankings(uint32_t &token, const RankType &rType, const RsGxsGrpMsgIdPair &msgId) +{ + token = RsGenExchange::generatePublicToken(); + + RsStackMutex stack(mPostedMutex); + + GxsPostedCommentRanking* gpc = new GxsPostedCommentRanking(); + gpc->msgId = msgId; + gpc->rType = rType; + gpc->pubToken = token; + + mPendingCommentRanks.insert(std::make_pair(token, gpc)); + + return true; +} + +bool p3Posted::requestMessageRankings(uint32_t &token, const RankType &rType, const RsGxsGroupId &groupId) +{ + token = RsGenExchange::generatePublicToken(); + + RsStackMutex stack(mPostedMutex); + GxsPostedPostRanking* gp = new GxsPostedPostRanking(); + gp->grpId = groupId; + gp->rType = rType; + gp->pubToken = token; + + mPendingPostRanks.insert(std::make_pair(token, gp)); + + return true; +} + +bool p3Posted::getRanking(const uint32_t &token, PostedRanking &ranking) +{ + +} + +void p3Posted::processRankings() +{ + processMessageRanks(); + + processCommentRanks(); +} + +void p3Posted::processMessageRanks() +{ + + RsStackMutex stack(mPostedMutex); + std::map::iterator mit =mPendingPostRanks.begin(); + + for(; mit !=mPendingPostRanks.begin(); mit++) + { + uint32_t token; + std::list grpL; + grpL.push_back(mit->second->grpId); + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; + opts.mOptions = RS_TOKREQOPT_MSG_LATEST | RS_TOKREQOPT_MSG_THREAD; + RsGenExchange::getTokenService()->requestMsgInfo(token, GXS_REQUEST_TYPE_GROUP_DATA, opts, grpL); + GxsPostedPostRanking* gp = mit->second; + gp->reqToken = token; + + while(true) + { + uint32_t status = RsGenExchange::getTokenService()->requestStatus(token); + + if(RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE + == status) + { + completePostedPostCalc(gp); + break; + } + else if(RsTokenService::GXS_REQUEST_V2_STATUS_FAILED + == status) + { + discardCalc(token); + break; + } + } + } + + mPendingPostRanks.clear(); + + +} + +void p3Posted::discardCalc(const uint32_t &token) +{ + +} + +void p3Posted::completePostedPostCalc(GxsPostedPostRanking *gpp) +{ + GxsMsgMetaMap msgMetas; + getMsgMeta(gpp->reqToken, msgMetas); + + GxsMsgMetaMap::iterator mit = msgMetas.begin(); + + for(; mit != msgMetas.end(); mit++ ) + { + RsGxsMsgMetaData* m = NULL; + //retrieveScores(m->mServiceString, upVotes, downVotes, nComments); + + // then dependent on rank request type process for that way + } + + +} + +bool p3Posted::retrieveScores(const std::string &serviceString, uint32_t &upVotes, uint32_t downVotes, uint32_t nComments) +{ + if (2 == sscanf(serviceString.c_str(), "%d %d %d", &upVotes, &downVotes, &nComments)) + { + return true; + } + + return false; +} + +void p3Posted::processCommentRanks() { } diff --git a/libretroshare/src/services/p3posted.h b/libretroshare/src/services/p3posted.h index 78e6c9ea5..62d7b789b 100644 --- a/libretroshare/src/services/p3posted.h +++ b/libretroshare/src/services/p3posted.h @@ -1,9 +1,34 @@ #ifndef P3POSTED_H #define P3POSTED_H +#include + #include "retroshare/rsposted.h" #include "gxs/rsgenexchange.h" + +class GxsPostedPostRanking +{ +public: + + uint32_t pubToken; + uint32_t reqToken; + RsPosted::RankType rType; + RsGxsGroupId grpId; + PostedRanking result; +}; + +class GxsPostedCommentRanking +{ +public: + + uint32_t pubToken; + uint32_t reqToken; + RsPosted::RankType rType; + RsGxsGrpMsgIdPair msgId; + PostedRanking result; +}; + class p3Posted : public RsGenExchange, public RsPosted { public: @@ -30,20 +55,34 @@ public: bool getPost(const uint32_t &token, PostedPostResult& posts) ; bool getComment(const uint32_t &token, PostedCommentResult& comments) ; bool getRelatedComment(const uint32_t& token, PostedRelatedCommentResult &comments); - bool getGroupRank(const uint32_t& token, GroupRank& grpRank); + bool getRanking(const uint32_t &token, PostedRanking &ranking); bool submitGroup(uint32_t &token, RsPostedGroup &group); bool submitPost(uint32_t &token, RsPostedPost &post); bool submitVote(uint32_t &token, RsPostedVote &vote); bool submitComment(uint32_t &token, RsPostedComment &comment) ; // Special Ranking Request. - bool requestRanking(uint32_t &token, RsGxsGroupId groupId) ; + bool requestMessageRankings(uint32_t &token, const RankType &rType, const RsGxsGroupId &groupId); + bool requestCommentRankings(uint32_t &token, const RankType &rType, const RsGxsGrpMsgIdPair &msgId); - // Control Ranking Calculations. -// bool setViewMode(uint32_t mode); -// bool setViewPeriod(uint32_t period); -// bool setViewRange(uint32_t first, uint32_t count); +private: + void processRankings(); + void processMessageRanks(); + void processCommentRanks(); + void discardCalc(const uint32_t& token); + void completePostedPostCalc(GxsPostedPostRanking* gpp); + bool retrieveScores(const std::string& serviceString, uint32_t& upVotes, uint32_t downVotes, uint32_t nComments); + +private: + + std::map mPendingPostRanks; + std::map mPendingCalculationPostRanks; + + std::map mPendingCommentRanks; + std::map mPendingCalculationCommentRanks; + + RsMutex mPostedMutex; }; #endif // P3POSTED_H diff --git a/retroshare-gui/src/gui/Posted/PostedComments.cpp b/retroshare-gui/src/gui/Posted/PostedComments.cpp index 04c07e467..7ef6be1d7 100644 --- a/retroshare-gui/src/gui/Posted/PostedComments.cpp +++ b/retroshare-gui/src/gui/Posted/PostedComments.cpp @@ -63,14 +63,10 @@ PostedComments::PostedComments(QWidget *parent) ui.setupUi(this); ui.postFrame->setVisible(false); ui.treeWidget->setup(rsPosted->getTokenService()); - connect(ui.treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(test(QPoint))); } -void PostedComments::test(QPoint p) +void PostedComments::loadRequest(const TokenQueue *queue, const TokenRequest &req) { - int x = p.x(); - int y = p.y(); - int c= x+y; } @@ -84,8 +80,8 @@ void PostedComments::loadComments(const RsPostedPost& post) RsGxsGrpMsgIdPair threadId; - threadId.first = post.mMeta.mOrigMsgId; - threadId.second = post.mMeta.mGroupId; + threadId.first = post.mMeta.mGroupId; + threadId.second = post.mMeta.mOrigMsgId; ui.treeWidget->requestComments(threadId); } @@ -107,7 +103,9 @@ void PostedComments::setUpPostFrame() ">" + QString::fromStdString(mCurrentPost.mLink) + ""); - ui.scoreLabel->setText(QString("1")); + ui.scoreLabel->setText(QString("0")); + + ui.notesBrowser->setPlainText(QString::fromStdString(mCurrentPost.mNotes)); } diff --git a/retroshare-gui/src/gui/Posted/PostedComments.h b/retroshare-gui/src/gui/Posted/PostedComments.h index 5bf557364..3053f18e1 100644 --- a/retroshare-gui/src/gui/Posted/PostedComments.h +++ b/retroshare-gui/src/gui/Posted/PostedComments.h @@ -44,12 +44,8 @@ public slots: void loadComments(const RsPostedPost& ); - private slots: - - void test(QPoint p); - private: - void loadRequest(const TokenQueue *queue, const TokenRequest &req) { return; } + void loadRequest(const TokenQueue *queue, const TokenRequest &req); void setUpPostFrame(); RsPostedPost mCurrentPost; diff --git a/retroshare-gui/src/gui/Posted/PostedComments.ui b/retroshare-gui/src/gui/Posted/PostedComments.ui index d06b8d0c1..817cc6ff7 100644 --- a/retroshare-gui/src/gui/Posted/PostedComments.ui +++ b/retroshare-gui/src/gui/Posted/PostedComments.ui @@ -23,10 +23,7 @@ - QFrame#frame{border: 2px solid #CCCCCC; -background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #EEEEEE, stop: 1 #CCCCCC); -border-radius: 10px} + background-color: rgb(203, 203, 203); QFrame::StyledPanel @@ -244,6 +241,13 @@ border-radius: 10px} + + + + background-color: rgb(203, 203, 203); + + + @@ -337,6 +341,11 @@ border-radius: 10px} Author + + + Date + + Points @@ -344,43 +353,6 @@ border-radius: 10px} - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Make Comment - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index 4f32e04e0..5332e57e6 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -48,7 +48,7 @@ GxsCommentTreeWidget::GxsCommentTreeWidget(QWidget *parent) { // QTreeWidget* widget = this; - + setContextMenuPolicy(Qt::CustomContextMenu); // QFont font = QFont("ARIAL", 10); // font.setBold(true); @@ -73,34 +73,32 @@ void GxsCommentTreeWidget::setCurrentMsgId(QTreeWidgetItem *current, QTreeWidget if(current) { mCurrentMsgId = current->text(PCITEM_COLUMN_MSGID).toStdString(); - }else{ - mCurrentMsgId = ""; } } void GxsCommentTreeWidget::customPopUpMenu(const QPoint& point) { QMenu contextMnu( this ); - contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Submit Comment"), this, SLOT(makeComment())); + QAction* action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Reply to Comment"), this, SLOT(replyToComment())); + action->setDisabled(mCurrentMsgId.empty()); + action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Submit Comment"), this, SLOT(makeComment())); + action->setDisabled(mThreadId.first.empty()); contextMnu.exec(QCursor::pos()); } void GxsCommentTreeWidget::makeComment() { + PostedCreateCommentDialog pcc(mTokenQueue, mThreadId, mThreadId.second, this); + pcc.exec(); +} - if(mCurrentMsgId.empty()) - { - PostedCreateCommentDialog pcc(mTokenQueue, mThreadId, mThreadId.second, this); - pcc.exec(); - } - else - { - RsGxsGrpMsgIdPair msgId; - msgId.first = mThreadId.first; - msgId.second = mCurrentMsgId; - PostedCreateCommentDialog pcc(mTokenQueue, msgId, mThreadId.second, this); - pcc.exec(); - } +void GxsCommentTreeWidget::replyToComment() +{ + RsGxsGrpMsgIdPair msgId; + msgId.first = mThreadId.first; + msgId.second = mCurrentMsgId; + PostedCreateCommentDialog pcc(mTokenQueue, msgId, mThreadId.second, this); + pcc.exec(); } void GxsCommentTreeWidget::setup(RsTokenService *service) @@ -125,100 +123,100 @@ void GxsCommentTreeWidget::requestComments(const RsGxsGrpMsgIdPair& threadId) void GxsCommentTreeWidget::service_requestComments(const RsGxsGrpMsgIdPair& threadId) { - /* request comments */ - std::cerr << "GxsCommentTreeWidget::service_requestComments(" << threadId.second << ")"; - std::cerr << std::endl; - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST; - - std::vector msgIds; - msgIds.push_back(threadId); - - uint32_t token; - mTokenQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, GXSCOMMENTS_LOADTHREAD); + /* request comments */ + std::cerr << "GxsCommentTreeWidget::service_requestComments(" << threadId.second << ")"; + std::cerr << std::endl; + + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA; + opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST; + + std::vector msgIds; + msgIds.push_back(threadId); + + uint32_t token; + mTokenQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, GXSCOMMENTS_LOADTHREAD); } /* Generic Handling */ void GxsCommentTreeWidget::clearItems() { - mPendingInsertMap.clear(); - mLoadingMap.clear(); + mPendingInsertMap.clear(); + mLoadingMap.clear(); } void GxsCommentTreeWidget::completeItems() { - /* handle pending items */ - std::string parentId; - QTreeWidgetItem *parent = NULL; - QList topLevelItems; + /* handle pending items */ + std::string parentId; + QTreeWidgetItem *parent = NULL; + QList topLevelItems; - std::map::iterator lit; - std::multimap::iterator pit; + std::map::iterator lit; + std::multimap::iterator pit; - std::cerr << "GxsCommentTreeWidget::completeItems() " << mPendingInsertMap.size(); - std::cerr << " PendingItems"; - std::cerr << std::endl; + std::cerr << "GxsCommentTreeWidget::completeItems() " << mPendingInsertMap.size(); + std::cerr << " PendingItems"; + std::cerr << std::endl; - for(pit = mPendingInsertMap.begin(); pit != mPendingInsertMap.end(); pit++) - { - std::cerr << "GxsCommentTreeWidget::completeItems() item->parent: " << pit->first; - std::cerr << std::endl; + for(pit = mPendingInsertMap.begin(); pit != mPendingInsertMap.end(); pit++) + { + std::cerr << "GxsCommentTreeWidget::completeItems() item->parent: " << pit->first; + std::cerr << std::endl; - if (pit->first != parentId) - { - /* find parent */ - parentId = pit->first; - lit = mLoadingMap.find(pit->first); - if (lit != mLoadingMap.end()) - { - parent = lit->second; - } - else - { - parent = NULL; - } - } + if (pit->first != parentId) + { + /* find parent */ + parentId = pit->first; + lit = mLoadingMap.find(pit->first); + if (lit != mLoadingMap.end()) + { + parent = lit->second; + } + else + { + parent = NULL; + } + } - if (parent) - { - std::cerr << "GxsCommentTreeWidget::completeItems() Added to Parent"; - std::cerr << std::endl; + if (parent) + { + std::cerr << "GxsCommentTreeWidget::completeItems() Added to Parent"; + std::cerr << std::endl; - parent->addChild(pit->second); - } - else if (parentId == mThreadId.second) - { - std::cerr << "GxsCommentTreeWidget::completeItems() Added to topLevelItems"; - std::cerr << std::endl; + parent->addChild(pit->second); + } + else if (parentId == mThreadId.second) + { + std::cerr << "GxsCommentTreeWidget::completeItems() Added to topLevelItems"; + std::cerr << std::endl; - topLevelItems.append(pit->second); - } - else - { + topLevelItems.append(pit->second); + } + else + { - /* missing parent -> insert At Top Level */ - QTreeWidgetItem *missingItem = service_createMissingItem(pit->first); + /* missing parent -> insert At Top Level */ + QTreeWidgetItem *missingItem = service_createMissingItem(pit->first); - std::cerr << "GxsCommentTreeWidget::completeItems() Added MissingItem"; - std::cerr << std::endl; + std::cerr << "GxsCommentTreeWidget::completeItems() Added MissingItem"; + std::cerr << std::endl; - parent = missingItem; - parent->addChild(pit->second); - topLevelItems.append(parent); - } - } + parent = missingItem; + parent->addChild(pit->second); + topLevelItems.append(parent); + } + } - /* now push final tree into Tree */ - clear(); - insertTopLevelItems(0, topLevelItems); + /* now push final tree into Tree */ + clear(); + insertTopLevelItems(0, topLevelItems); - /* cleanup temp stuff */ - mLoadingMap.clear(); - mPendingInsertMap.clear(); + /* cleanup temp stuff */ + mLoadingMap.clear(); + mPendingInsertMap.clear(); } @@ -316,7 +314,8 @@ void GxsCommentTreeWidget::service_loadThread(const uint32_t &token) text = QString::fromUtf8(comment.mMeta.mParentId.c_str()); item->setText(PCITEM_COLUMN_PARENTID, text); - text = QString::fromUtf8(comment.mMeta.mServiceString.c_str()); + text = QString::fromUtf8("0"); + //text = QString::fromUtf8(comment.mMeta.mServiceString.c_str()); item->setText(PCITEM_COLUMN_SERVSTRING, text); addItem(comment.mMeta.mMsgId, comment.mMeta.mParentId, item); diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h index 448c2e324..f494e25e3 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h @@ -26,19 +26,6 @@ #include "util/TokenQueue.h" -/* indicies for search results item columns SR_ = Search Result */ -#define SR_NAME_COL 0 -#define SR_SIZE_COL 1 -#define SR_ID_COL 2 -#define SR_TYPE_COL 3 -#define SR_AGE_COL 4 -#define SR_HASH_COL 5 -#define SR_SEARCH_ID_COL 6 -#define SR_UID_COL 7 -#define SR_DATA_COL SR_NAME_COL - -#define SR_ROLE_LOCAL Qt::UserRole - class GxsCommentTreeWidget : public QTreeWidget, public TokenResponse { Q_OBJECT @@ -49,7 +36,7 @@ public: void requestComments(const RsGxsGrpMsgIdPair& threadId); void getCurrentMsgId(RsGxsMessageId& parentId); - void setCurrentMsgId(QTreeWidgetItem* current, QTreeWidgetItem* previous); + void applyRankings(std::map& positions); void loadRequest(const TokenQueue *queue, const TokenRequest &req); @@ -70,10 +57,11 @@ protected: public slots: void customPopUpMenu(const QPoint& point); -private slots: + void setCurrentMsgId(QTreeWidgetItem* current, QTreeWidgetItem* previous); void makeComment(); + void replyToComment(); protected: