fixed missing returns

This commit is contained in:
csoler 2020-03-21 15:46:52 +01:00
parent 2387150f64
commit b8ec91aac5
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
6 changed files with 25 additions and 21 deletions

View File

@ -307,8 +307,18 @@ bool p3Posted::getBoardsInfo(
uint32_t token;
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
if( !requestGroupInfo(token, opts, boardsIds)
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
if(boardsIds.empty())
{
if( !requestGroupInfo(token, opts) || waitToken(token) != RsTokenService::COMPLETE )
return false;
}
else
{
if( !requestGroupInfo(token, opts, boardsIds) || waitToken(token) != RsTokenService::COMPLETE )
return false;
}
return getGroupData(token, groupsInfo) && !groupsInfo.empty();
}

View File

@ -163,6 +163,8 @@ bool PostedDialog::getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo)
for (auto& group: groups)
groupInfo.push_back(new RsPostedGroup(group));
return true;
}
GxsGroupDialog *PostedDialog::createNewGroupDialog(TokenQueue *tokenQueue)

View File

@ -358,16 +358,6 @@ bool GxsChannelDialog::getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo
for (auto& group: groups)
groupInfo.push_back(new RsGxsChannelGroup(group));
// if (group.mImage.mData != NULL) {
// QPixmap image;
// GxsIdDetails::loadPixmapFromData(group.mImage.mData, group.mImage.mSize, image,GxsIdDetails::ORIGINAL);
// channelData->mIcon[group.mMeta.mGroupId] = image;
// }
//
// if (!group.mDescription.empty()) {
// channelData->mDescription[group.mMeta.mGroupId] = QString::fromUtf8(group.mDescription.c_str());
// }
return true;
}

View File

@ -46,14 +46,16 @@ protected:
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; }
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Channel; }
virtual QString getHelpString() const ;
virtual void groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo);
virtual bool getDistantSearchResults(TurtleRequestId id, std::map<RsGxsGroupId,RsGxsGroupSummary>& group_infos);
virtual const std::set<TurtleRequestId> getSearchRequests() const override { return mSearchResults ; }
virtual TurtleRequestId distantSearch(const QString& search_string) ;
virtual void checkRequestGroup(const RsGxsGroupId& grpId) ;
virtual UserNotify *createUserNotify(QObject *parent) override;
const std::set<TurtleRequestId> getSearchRequests() const override { return mSearchResults ; }
UserNotify *createUserNotify(QObject *parent) override;
bool getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo) override;
void groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo) override;
private slots:
void toggleAutoDownload();
void setDefaultDirectory();
@ -74,8 +76,6 @@ private:
virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId);
virtual uint32_t requestGroupSummaryType() { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data
bool getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo) override;
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
std::set<TurtleRequestId> mSearchResults;

View File

@ -89,6 +89,8 @@ bool GxsForumsDialog::getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo)
for (auto& group: groups)
groupInfo.push_back(new RsGxsForumGroup(group));
return true;
}
@ -199,6 +201,7 @@ GxsMessageFrameWidget *GxsForumsDialog::createMessageFrameWidget(const RsGxsGrou
return new GxsForumThreadWidget(groupId);
}
#ifdef TO_REMOVE
void GxsForumsDialog::loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata *&userdata)
{
std::vector<RsGxsForumGroup> groups;
@ -218,6 +221,7 @@ void GxsForumsDialog::loadGroupSummaryToken(const uint32_t &token, std::list<RsG
}
}
}
#endif
void GxsForumsDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo)
{

View File

@ -40,14 +40,13 @@ public:
void shareInMessage(const RsGxsGroupId& forum_id, const QList<RetroShareLink>& file_link) ;
protected:
virtual UserNotify *createUserNotify(QObject *parent) override;
virtual QString getHelpString() const ;
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; }
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Forum; }
void groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo) override;
UserNotify *createUserNotify(QObject *parent) override;
bool getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo) override;
void groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo) override;
private:
/* GxsGroupFrameDialog */
@ -59,7 +58,6 @@ private:
virtual int shareKeyType();
virtual GxsMessageFrameWidget *createMessageFrameWidget(const RsGxsGroupId &groupId);
virtual uint32_t requestGroupSummaryType() { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data
virtual void loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata* &userdata);
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);