mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 18:09:32 -04:00
Source code maintenance
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5897 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8cef4da896
commit
6fba395054
2 changed files with 60 additions and 83 deletions
|
@ -26,16 +26,14 @@
|
|||
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
/******
|
||||
* #define ID_DEBUG 1
|
||||
*****/
|
||||
|
||||
/** Constructor */
|
||||
TokenQueue::TokenQueue(RsTokenService *service, TokenResponse *resp)
|
||||
:QWidget(NULL), mService(service), mResponder(resp)
|
||||
: QWidget(NULL), mService(service), mResponder(resp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<RsGxsGroupId>& ids, uint32_t usertype)
|
||||
|
@ -47,7 +45,6 @@ bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTok
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_GROUPINFO;
|
||||
|
@ -66,7 +63,6 @@ bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokRe
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TokenQueue::requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair> &msgId, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_MSGINFO;
|
||||
|
@ -76,7 +72,6 @@ bool TokenQueue::requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
const std::list<RsGxsGroupId> &grpIds, uint32_t usertype)
|
||||
{
|
||||
|
@ -119,14 +114,11 @@ void TokenQueue::doPoll(float dt)
|
|||
QTimer::singleShot((int) (dt * 1000.0), this, SLOT(pollRequests()));
|
||||
}
|
||||
|
||||
|
||||
void TokenQueue::pollRequests()
|
||||
{
|
||||
double pollPeriod = 1.0; // max poll period.
|
||||
|
||||
|
||||
if (mRequests.empty())
|
||||
{
|
||||
if (mRequests.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -155,7 +147,6 @@ void TokenQueue::pollRequests()
|
|||
std::cerr << "Dropping old Token: " << req.mToken << " Type: " << req.mType;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (mRequests.size() > 0)
|
||||
|
@ -164,7 +155,6 @@ void TokenQueue::pollRequests()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
bool TokenQueue::checkForRequest(uint32_t token)
|
||||
{
|
||||
/* check token */
|
||||
|
@ -182,11 +172,8 @@ void TokenQueue::loadRequest(const TokenRequest &req)
|
|||
std::cerr << std::endl;
|
||||
|
||||
mResponder->loadRequest(this, req);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool TokenQueue::cancelRequest(const uint32_t token)
|
||||
{
|
||||
/* cancel at lower level first */
|
||||
|
@ -212,9 +199,3 @@ bool TokenQueue::cancelRequest(const uint32_t token)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <gxs/rstokenservice.h>
|
||||
|
||||
|
||||
|
||||
#define COMPLETED_REQUEST 4
|
||||
|
||||
#define TOKENREQ_GROUPINFO 1
|
||||
|
@ -45,7 +44,7 @@ class TokenQueue;
|
|||
|
||||
class TokenRequest
|
||||
{
|
||||
public:
|
||||
public:
|
||||
uint32_t mToken;
|
||||
uint32_t mType;
|
||||
uint32_t mAnsType;
|
||||
|
@ -56,7 +55,7 @@ class TokenRequest
|
|||
|
||||
class TokenResponse
|
||||
{
|
||||
public:
|
||||
public:
|
||||
//virtual ~TokenResponse() { return; }
|
||||
// These Functions are overloaded to get results out.
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req) = 0;
|
||||
|
@ -84,7 +83,6 @@ public:
|
|||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
std::list<RsGxsGroupId>& ids, uint32_t usertype);
|
||||
|
||||
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, uint32_t usertype);
|
||||
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
|
@ -118,5 +116,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue