mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-13 08:35:45 -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 "ui_GxsChannelGroupItem.h"
|
||||
|
||||
#include "FeedHolder.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "gui/NewsFeed.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
|
||||
|
@ -89,29 +90,39 @@ bool GxsChannelGroupItem::setGroup(const RsGxsChannelGroup &group)
|
|||
return true;
|
||||
}
|
||||
|
||||
void GxsChannelGroupItem::loadGroup(const uint32_t &token)
|
||||
void GxsChannelGroupItem::loadGroup()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "GxsChannelGroupItem::loadGroup()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
std::vector<RsGxsChannelGroup> groups;
|
||||
if (!rsGxsChannels->getGroupData(token, groups))
|
||||
RsThread::async([this]()
|
||||
{
|
||||
std::cerr << "GxsChannelGroupItem::loadGroup() ERROR getting data";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
// 1 - get group data
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "GxsChannelGroupItem::loadGroup() Wrong number of Items";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
std::vector<RsGxsChannelGroup> groups;
|
||||
const std::list<RsGxsGroupId> groupIds = { groupId() };
|
||||
|
||||
setGroup(groups[0]);
|
||||
if(!rsGxsChannels->getChannelsInfo(groupIds,groups))
|
||||
{
|
||||
RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
RsGxsChannelGroup 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 GxsChannelGroupItem::groupName()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue