diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index f878721c9..3c323e286 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -584,12 +584,13 @@ void CreateCircleDialog::createCircle() circle.mMeta.mCircleType = GXS_CIRCLE_TYPE_LOCAL; } + bool is_existing_circle(mIsExistingCircle); - RsThread::async([&circle,this]() + RsThread::async([circle,is_existing_circle]() { RsGxsCircleId circleId; - if(mIsExistingCircle) + if(is_existing_circle) { #ifdef DEBUG_CREATE_CIRCLE_DIALOG std::cerr << "CreateCircleDialog::updateCircle() : mCircleType: " << circle.mMeta.mCircleType << std::endl; @@ -598,7 +599,7 @@ void CreateCircleDialog::createCircle() std::cerr << "CreateCircleDialog::updateCircle() Checks and Balances Okay - calling service proper.."<< std::endl; #endif - rsGxsCircles->editCircle(circle); + rsGxsCircles->editCircle(*const_cast(&circle)); // const_cast: Not nice, but simpler. circleId = RsGxsCircleId(circle.mMeta.mGroupId); } @@ -619,14 +620,14 @@ void CreateCircleDialog::createCircle() circle.mLocalFriends); } - RsQThreadUtils::postToObject( [this,circle,circleId]() - { - if(!mIsExistingCircle) - QMessageBox::information(nullptr,tr("Circle created"), - tr("Your new circle has been created:\n Name: %1\n Id: %2.") - .arg(QString::fromUtf8(circle.mMeta.mGroupName.c_str())) - .arg(QString::fromStdString(circleId.toStdString()))); - }); + if(!is_existing_circle) + RsQThreadUtils::postToObject( [circle,circleId]() + { + QMessageBox::information(nullptr,tr("Circle created"), + tr("Your new circle has been created:\n Name: %1\n Id: %2.") + .arg(QString::fromUtf8(circle.mMeta.mGroupName.c_str())) + .arg(QString::fromStdString(circleId.toStdString()))); + }); }); close(); diff --git a/retroshare-gui/src/gui/NewsFeed.h b/retroshare-gui/src/gui/NewsFeed.h index 2e3d7e5ed..2b246fb4c 100644 --- a/retroshare-gui/src/gui/NewsFeed.h +++ b/retroshare-gui/src/gui/NewsFeed.h @@ -24,7 +24,6 @@ #include #include "gui/feeds/FeedHolder.h" -#include "util/TokenQueue.h" #include #define IMAGE_NEWSFEED ":/icons/png/newsfeed.png" diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 9a46b65f0..a9c0a95a7 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -1213,48 +1213,3 @@ void PostedListWidgetWithModel::voteMsg(RsGxsGrpMsgIdPair msg,bool up_or_down) updateDisplay(true); } -#ifdef TODO -class PostedPostsReadData -{ -public: - PostedPostsReadData(bool read) - { - mRead = read; - mLastToken = 0; - } - -public: - bool mRead; - uint32_t mLastToken; -}; - -static void setAllMessagesReadCallback(FeedItem *feedItem, void *data) -{ - GxsChannelPostItem *channelPostItem = dynamic_cast(feedItem); - if (!channelPostItem) { - return; - } - - GxsChannelPostsReadData *readData = (GxsChannelPostsReadData*) data; - bool isRead = !channelPostItem->isUnread() ; - - if(channelPostItem->isLoaded() && (isRead == readData->mRead)) - return ; - - RsGxsGrpMsgIdPair msgPair = std::make_pair(channelPostItem->groupId(), channelPostItem->messageId()); - rsGxsChannels->setMessageReadStatus(readData->mLastToken, msgPair, readData->mRead); -} - -void PostedListWidgetWithModel::setAllMessagesReadDo(bool read, uint32_t &token) -{ - if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags)) { - return; - } - - GxsChannelPostsReadData data(read); - //ui->feedWidget->withAll(setAllMessagesReadCallback, &data); - - token = data.mLastToken; -} - -#endif diff --git a/retroshare-gui/src/gui/feeds/GxsCircleItem.h b/retroshare-gui/src/gui/feeds/GxsCircleItem.h index dc83dd30d..74f2cf44a 100644 --- a/retroshare-gui/src/gui/feeds/GxsCircleItem.h +++ b/retroshare-gui/src/gui/feeds/GxsCircleItem.h @@ -24,8 +24,6 @@ #include #include "FeedItem.h" -#include "util/TokenQueue.h" - namespace Ui { class GxsCircleItem; } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index c6c3e8078..432684362 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -672,15 +672,9 @@ void GxsGroupDialog::createGroup() if (service_createGroup(meta)) { - // now update the UI #warning Missing code here! -#ifdef TODO - // - // get the Queue to handle response. What is this for? - if(mExternalTokenQueue != NULL) - mExternalTokenQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, GXSGROUP_NEWGROUPID); -#endif - } + // now update the UI + } close(); } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h index 4860f52a8..b5e9417d0 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h @@ -23,8 +23,6 @@ #include "ui_GxsGroupDialog.h" -#include "util/TokenQueue.h" - /******** * Notes: * @@ -284,9 +282,6 @@ private: std::list mShareList; QPixmap mPicture; - RsTokenService *mTokenService; - TokenQueue *mExternalTokenQueue; - TokenQueue *mInternalTokenQueue; RsGroupMetaData mGrpMeta; Mode mMode; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index c6afc2ca9..fbf09350a 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -56,8 +56,6 @@ * #define DEBUG_CHANNEL ***/ -//static const int mTokenTypeGroupData = 1; - static const int CHANNEL_TABS_DETAILS= 0; static const int CHANNEL_TABS_POSTS = 1; static const int CHANNEL_TABS_FILES = 2; @@ -1430,12 +1428,10 @@ public: explicit GxsChannelPostsReadData(bool read) { mRead = read; - mLastToken = 0; } public: bool mRead; - uint32_t mLastToken; }; void GxsChannelPostsWidgetWithModel::setAllMessagesReadDo(bool read)