mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-30 01:38:51 -04:00
removed most of the token queue system from GxsFeedItems
This commit is contained in:
parent
d1b26c9d36
commit
7e08d24b64
18 changed files with 607 additions and 491 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "FeedHolder.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
|
||||
/****
|
||||
* #define DEBUG_ITEM 1
|
||||
|
@ -87,29 +88,43 @@ bool GxsForumGroupItem::setGroup(const RsGxsForumGroup &group)
|
|||
return true;
|
||||
}
|
||||
|
||||
void GxsForumGroupItem::loadGroup(const uint32_t &token)
|
||||
void GxsForumGroupItem::loadGroup()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "GxsForumGroupItem::loadGroup()";
|
||||
std::cerr << std::endl;
|
||||
RsThread::async([this]()
|
||||
{
|
||||
// 1 - get group data
|
||||
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "Retrieving post data for post " << mThreadId << std::endl;
|
||||
#endif
|
||||
|
||||
std::vector<RsGxsForumGroup> groups;
|
||||
if (!rsGxsForums->getGroupData(token, groups))
|
||||
{
|
||||
std::cerr << "GxsForumGroupItem::loadGroup() ERROR getting data";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
std::vector<RsGxsForumGroup> groups;
|
||||
const std::list<RsGxsGroupId> forumIds = { groupId() };
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "GxsForumGroupItem::loadGroup() Wrong number of Items";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
if(!rsGxsForums->getForumsInfo(forumIds,groups))
|
||||
{
|
||||
RsErr() << "GxsForumGroupItem::loadGroup() ERROR getting data" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
setGroup(groups[0]);
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "GxsForumGroupItem::loadGroup() Wrong number of Items";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
const RsGxsForumGroup& group(groups[0]);
|
||||
|
||||
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 */
|
||||
|
||||
setGroup(group);
|
||||
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
QString GxsForumGroupItem::groupName()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue